package com.xyj.review;

import com.xyj.week01.Node;

/**
 * 寻找链表中点
 * @author GuXiaoYao
 * @version 1.0.0
 * @since 2021/9/9
 */
public class T2 {


    public static void main(String[] args) {

    }

    public Node getTheMiddleNode(Node head){
        Node slow=head;
        Node fast=head;
        while (fast.next!=null&&fast.next.next!=null){
            slow=slow.next;
            fast=fast.next.next;
        }
        return slow;
    }
}
